# PHP For Apache
# Date: 2013-12-30
php4apache_install() {
cd $CWD
logs "Info" "Decompress php-${phpVer}.tar.gz"
tar -zxf php-${phpVer}.tar.gz
logs "Info" "Decompress php-5.3.28-Patch4ApacheByLuxiaok.tgz"
tar -zxvf php-5.3.28-Patch4ApacheByLuxiaok.tgz
cd php-$phpVer
./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/etc/php.d \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-iconv-dir=/usr/local \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-bz2 \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-magic-quotes \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--with-gettext \
--without-pear
make ZEND_EXTRA_LIBS='-liconv' && make install
mkdir -p /usr/local/php/etc/php.d
cp php.ini-production /usr/local/php/etc/php.ini
ln -s /usr/local/php/etc/php.ini /etc/php.ini
}